//
//  CityDTO.m
//  FastDoctor
//
//  Created by 李通 on 16/7/6.
//  Copyright © 2016年 sc. All rights reserved.
//

#import "CityDTO.h"

@implementation CityDTO

+ (instancetype)modelWithDict:(NSDictionary *)dict {
    
    CityDTO *cityModel = [[CityDTO alloc]init];
    
    [cityModel setValuesForKeysWithDictionary:dict];
    
    return cityModel;
}

+ (NSArray<CityDTO *> *)cityList {
    
    NSString *filePath = [[NSBundle mainBundle]pathForResource:@"province.plist" ofType:nil];
    
    NSArray *array = [NSArray arrayWithContentsOfFile:filePath];
    
    NSMutableArray *mArray = [NSMutableArray array];
    
    [array enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        
        CityDTO *cityModel = [CityDTO modelWithDict:obj];
        
        [mArray addObject:cityModel];
    }];
    return mArray.copy;
}

@end
